package com.light.util;

import atlantafx.base.theme.Theme;
import com.light.model.GitProject;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 全局数据工具类
 */
public final class FxApplicationContextUtils {

    /**
     * 全局容器
     */
    public static final Map<String, Object> GLOBAL_CONTEXT_MAP = new ConcurrentHashMap<>();

    /**
     * 正在下载数量
     */
    public static final AtomicInteger DOWNLOAD_NUMBER = new AtomicInteger(0);
    public static final SimpleStringProperty DOWNLOAD_PROPERTY = new SimpleStringProperty(DOWNLOAD_NUMBER.toString());
    public static final ObservableList<HBox> DOWNLOAD_LIST = FXCollections.observableArrayList();

    /**
     * 正在更新数量
     */
    public static final AtomicInteger UPDATE_NUMBER = new AtomicInteger(0);
    public static final SimpleStringProperty UPDATE_PROPERTY = new SimpleStringProperty(UPDATE_NUMBER.toString());
    /**
     * git项目集合
     */
    public static final ObservableList<GitProject> GIT_PROJECT_OBSERVABLE_LIST = FXCollections.observableArrayList();

    /**
     * 当前主题名称
     */
    public static final SimpleStringProperty CURRENT_THEME_NAME = new SimpleStringProperty();

    /**
     * 所有主题
     */
    public static final List<Theme> THEME_LIST = new ArrayList<>(7);

    /**
     * 历史通知集合
     */
    public static final ObservableList<HBox> HISTORY_NOTICE_LIST = FXCollections.observableArrayList();
}
